package com.ujiuy.springsessiondemo.Thymeleaf;

import com.ujiuy.springsessiondemo.entity.user;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
public class Demo3 {

    @GetMapping("/third")
    public String two(Model model){
        List<user> list = new ArrayList<>();
        list.add(new user(1,"peng",12));
        list.add(new user(2,"gao",13));
        list.add(new user(3,"zhang",14));
        model.addAttribute("list",list);
        return "index3";
    }
}
